<template>
  <div class="right-panel">
    <div class="right-header">
      <i class="el-icon-d-arrow-right" @click="close"></i>
      <span>单位相关资料</span>
    </div>
    <div class="right-content">
      <div class="div1">
        <span>申请单位：</span><span>{{ obj.applyUserName }}</span>
      </div>
      <div class="div2">
        <span>申请村庄：</span><span>{{ obj.village }}</span>
      </div>
      <div class="div2">
        <span>申请时间：</span><span>{{ obj.applyDate }}</span>
      </div>
      <div class="div2">
        <span>联系人：</span><span>{{ obj.contactName }}</span>
      </div>
      <div class="file-list">
        <div class="list-header">
          <div>
            <i class="iconfont icon-wenjianjia" />
            <span>附件材料</span>
          </div>
          <i class="iconfont icon-shangchuanbeifen"></i>
        </div>
        <el-tree
          :data="fileList"
          accordion
          @node-click="handleNodeClick"
          :default-expand-all="true"
        >
        </el-tree>
      </div>

      <div class="button-group">
        <div class="b1" @click="allow">通过</div>
        <div class="b2" @click="refuse">退返</div>
      </div>
    </div>
  </div>
</template>
<script>
import {picHost} from '@/settings.js'
export default {
  data() {
    return {
    };
  },
  props: {
    obj: {
      type: Object,
      default: {},
    },
    fileList:{
      type:Array,
      default:[]
    }
  },
  methods: {
    close() {
      this.$emit("closeRightPanel");
    },
    allow() {
      this.$emit("open", this.obj);
    },
    refuse(){
       this.$emit("open1", this.obj);
    },
    handleNodeClick(data) {
      window.open(picHost+data.url)  
    },
  },
};
</script>
<style lang="scss" scoped>
.right-panel {
  position: absolute;
  right: 0;
  top: 54px;
  bottom: 0;
  width: 280px;
  z-index: 9999;
  background-color: #f2f2f2;
  .right-header {
    height: 35px;
    font-size: 18px;
    font-weight: 600;
    background-color: #4778c7;
    color: #fff;
    line-height: 35px;
    i {
      margin-right: 10px;
    }
  }
  .right-content {
    margin-left: 10px;
    width: calc(100% - 10px);
    height: calc(100% - 35px);
    background-color: #fff;
    padding: 10px;
    .list-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 14px;
      background-color: #e2e7f0;
      height: 32px;
      line-height: 32px;
      padding: 0 10px;
      span {
        margin-left: 5px;
      }
    }
    .div1 {
      font-size: 16px;
      font-weight: 600;
      padding-top: 10px;
      border-bottom: 2px solid #4778c7;
      padding-bottom: 5px;
      color: #27408b;
    }
    .div2 {
      font-size: 16px;
      padding: 10px 0px;
    }

    .button-group {
      display: flex;
      border-top: 1px dashed #ccc;
      padding-top: 20px;
      justify-content: center;
      margin-top: 40px;
      div {
        padding: 5px 15px;
        width: 80px;
        height: 30px;
        border-radius: 3px;
        color: #fff;
        margin-right: 15px;
        text-align: center;
      }
      .b1 {
        background-color: #4778c7;
      }
      .b2 {
        background-color: #cdc5bf;
      }
    }
  }
}
</style>
